<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<%@ include file="/common/meta.jsp"%>
	<title>汪星客 - 申请为主人</title>
</head>
<body>
<div class="wrap">
	<div class="header_bg">
		<div class="header box">
            <%@ include file="/common/header.jsp"%>
        </div>
    </div>
    <div class="w">
    	<div class="path box">
            <jsp:include page="/common/frame/frame_path.jsp">
           		<jsp:param name="current" value="申请成为主人"/>
           	</jsp:include>
        </div>
    </div>
    <div class="main">
    	<div class="padt16 box">
        	<div class="apply">
            	<h4>尽量详细的填写下面信息将有效的帮助您快速通过审核，并获得更多的代养机会</h4>
                <form id="frame_apply_form" method="post" action="${ctx}/host/applySave.do">
	                <div class="apply_form">
	                	<h2>公开信息</h2>
	                    <div class="info"><p class="font_s">房屋类型</p>
	                    	<select name="apply.hostHouseName" class="easyui-combobox" data-options="panelHeight:'auto',editable:false,required:true"> 
								<option>高层楼房（带电梯）</option>
								<option>低层楼房（无电梯）</option> 
								<option>平房</option>
								<option>别墅</option>
							</select>
	                    </div>
	                    <div class="info">
	                    	<p class="font_s">个人介绍</p>
	                    	<textarea name="apply.userDescribe" class="easyui-validatebox" data-options="required:true, prompt:'请输入您的个人介绍。'"></textarea>
	                    </div>
	                    <div class="info">
	                    	<p class="font_s">您有几年宠物狗饲养经验？</p>
	                    	<input class="ipt_txt easyui-validatebox" type="text" name="apply.hostExperience" data-options="required:true, validType:['Number','length[1,2]']"/>
	                    </div>
	                    <div class="info">
	                    	<p><span class="font_s">寄养服务价格</span> （元 / 晚）</p>
	                    	<input class="ipt_txt easyui-validatebox" type="text" name="apply.serverVal" data-options="required:true, validType:'money'"/>
	                    </div>
	                </div>
	                <div class="apply_form">
	                	<h2>保密信息</h2>
	                    <div class="info">以下信息仅作为提交申请的验证信息使用，我们不会将其向任何第三方机构和个人公开，请放心填写</div>
	                    <div class="info">
		                    <p class="font_s">移动电话</p>
		                    <input class="ipt_txt easyui-validatebox" type="text" name="apply.userTel" data-options="required:true"/>
	                    </div>
	                    <div class="info">
		                    <p class="font_s">身份证号码</p>
		                    <input class="ipt_txt easyui-validatebox" type="text" name="apply.userCard" data-options="required:true"/>
	                    </div>
	                    <div class="info">
	                    	<p class="font_s">详细地址</p>
	                    	<input class="ipt_txt easyui-validatebox" type="text" name="apply.hostAddress" data-options="required:true"/>
	                    </div>
	                </div>
                </form>
                <div class="apply_btn"><a href="javascript:void(0);" onclick="submitApply(this)" class="tg-btn easyui-linkbutton">提交</a></div>
            </div>
		</div>
    </div>
    <div class="footer_bg">
    	<%@ include file="/common/footer.jsp"%>
    </div>
</div>
</body>
<script type="text/javascript">
function submitApply(btn) {
	frame.submitForm("frame_apply_form", btn, function(res) {
        if (res.code == 1) {
        	msg.alert("系统消息", "申请信息保存成功！<br/>请等待服务人员与您联系。", function(){
        		window.location.href = "${ctx}/";
        	});
        } else {
        	msg.err(res.msg);
        }
    });
}

$('#frame_apply_form').form({
	onLoadSuccess:function(apply) {
		frame.onLoadForm(this, "apply", apply);
// 		if(!$.isEmptyObject(apply)) {
			
// 		}
	}
}).form('load', "${ctx}/host/getApply.do");
</script>
</html>

